import React from 'react'
import TopHeader from '../../components/news/TopHeader'
import SideMenu from '../../components/news/SideMenu'
import { Layout } from 'antd'
import './news.scss'
import { Routes, Route, Navigate } from 'react-router-dom'

// 导入各个子页面组件
import UserAdd from '../../components/news/user/UserAdd'
import UserDelete from '../../components/news/user/UserDelete'
import RoleList from '../../components/news/user/RoleList'
import PermissionList from '../../components/news/user/PermissionList'
import NewsList from '../../components/news/content/NewsList'
import NewsCategory from '../../components/news/content/NewsCategory'
import ArticleList from '../../components/news/content/ArticleList'
import ArticleCategory from '../../components/news/content/ArticleCategory'
import TagManage from '../../components/news/content/TagManage'
import CommentManage from '../../components/news/content/CommentManage'

const { Content } = Layout;

export default function News() {
  return (
    <Layout className='layout'>
      <SideMenu />
      <Layout>
        <TopHeader></TopHeader>
        <Content
          style={{
            margin: '24px 16px',
            padding: 24,
            minHeight: 280,
            background: "white",
            borderRadius: "10px",
          }}
        >
          <Routes>
            <Route path="/" element={<Navigate to="/news/user_add" replace />} />
            <Route path="/user_add" element={<UserAdd />} />
            <Route path="/user_delete" element={<UserDelete />} />
            <Route path="/role_list" element={<RoleList />} />
            <Route path="/permission_list" element={<PermissionList />} />
            <Route path="/news_list" element={<NewsList />} />
            <Route path="/news_category" element={<NewsCategory />} />
            <Route path="/article_list" element={<ArticleList />} />
            <Route path="/article_category" element={<ArticleCategory />} />
            <Route path="/tag_manage" element={<TagManage />} />
            <Route path="/comment_manage" element={<CommentManage />} />
          </Routes>
        </Content>
      </Layout>
    </Layout>
  )
}
